import java.io.*;

class Father /*implements Serializable*/ {
	public Father() { System.out.println("Whitin Father"); }
	public Father(int i) {};
	int inherited = 10;
	int hided = 20;
}

public class Serialization extends Father implements Serializable {
	Serialization(int i) { super(i); }
	int hided = 30;
	
	public static void main(String[] args) throws IOException, ClassNotFoundException {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(baos);
		System.out.println("Creating object");
		Serialization ser = new Serialization(1);
		System.out.println("Serializing object");
		oos.writeObject(ser);
		ObjectInputStream ois = new ObjectInputStream(
		new ByteArrayInputStream(baos.toByteArray()));
		System.out.println("Deserialzing object");
		Father ser2 = (Father) ois.readObject();
		System.out.println(ser2.inherited + "\n" + ser2.hided);
	}

}